#include "motorControl.h"
#include "uart.h"
#include "checksum.h"

void setMotorSpeed(uint8_t left, uint8_t right)
{
	uint8_t data[6] = {HEADER_DATA_BYTE, 0x1e, 0xa2, left, right, 0x00};
   	data[5]=constructChecksum(data, 5);
	sendUART(data, 6);
	
	//vtI2CEnQ(myDevPtr,vtI2CMsgTypeMotorCommand,0x17,sizeof(data),data,0);
}

void reqSensorData()
{	
	uint8_t data[6] = {HEADER_DATA_BYTE, 0x4E, 0xB1, 0x00, HEADER_DATA_BYTE, 0x4F};
   	data[3] = constructChecksum(data, 3);
	sendUART(data, 6);

}

void reqEncoderData()
{
	uint8_t data[6] = {HEADER_DATA_BYTE, 0x1E, 0xA1, 0x00, HEADER_DATA_BYTE, 0x1F};
   	data[3] = constructChecksum(data, 3);
	sendUART(data, 6);
}